#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:

    int MLS(vector<int>& arr)
    {
        sort(arr.begin(), arr.end());
        int ret = 0;
        for (int i = 0; i < arr.size();)
        {
            int j = i + 1, count = 1;
            while (j < arr.size())
            {
                if (arr[j] - arr[j - 1] == 1)
                {
                    count++;
                    j++;
                }
                else if (arr[j] - arr[j - 1] == 0)
                {
                    j++;
                }
                else {
                    break;
                }
            }
            ret = max(ret, count);
            i = j;
        }

        return ret;
    }
};

//int func(int a, int b)
//{
//    if (b == 0) return a;
//    return func(b, a % b);
//}
//
//int main()
//{
//    int a, b;
//    cin >> a >> b;
//
//    cout << (a * b / func(a, b)) << endl;
//    return 0;
//}